Skip to content

Switch to postgres 16 image#577

Open
ShimShtein wants to merge 1 commit into
theforeman:masterfrom
ShimShtein:test_pg16
Open

Switch to postgres 16 image#577
ShimShtein wants to merge 1 commit into
theforeman:masterfrom
ShimShtein:test_pg16

Conversation

@ShimShtein

Copy link
Copy Markdown
Member

Why are you introducing these changes? (Problem description, related links)

As part of being prepared to run on RHEL 10, we need to switch to postgres 16.

What are the changes introduced in this pull request?

  • Switch of the container to postgres 16 instead of 13.

How to test this pull request

If the system spins up successfully and works with content - it's good to go.

@ShimShtein ShimShtein marked this pull request as ready for review June 18, 2026 13:25
@ShimShtein

Copy link
Copy Markdown
Member Author

Extracted out of #395

@evgeni

evgeni commented Jun 18, 2026

Copy link
Copy Markdown
Member

Extracted out of #395

What for? (#395 already identified the problems with it)

@ShimShtein

Copy link
Copy Markdown
Member Author

Because #395 has both postgres and valkey in the same PR?

@ShimShtein

Copy link
Copy Markdown
Member Author

I see the tests are failing on password encryption algorithm detection: https://github.com/theforeman/foremanctl/actions/runs/27768839212/job/82162895170?pr=577#step:17:643
That's weird. Locally the same setup gives me:

[vagrant@quadlet ~]$ sudo podman exec postgresql psql -U postgres -c 'SHOW password_encryption'
 password_encryption 
---------------------
 scram-sha-256
(1 row)

Which is weird.

@evgeni evgeni force-pushed the test_pg16 branch 2 times, most recently from f9dc89d to f6f88a0 Compare June 22, 2026 09:40
@evgeni

evgeni commented Jun 22, 2026

Copy link
Copy Markdown
Member

I see the tests are failing on password encryption algorithm detection: https://github.com/theforeman/foremanctl/actions/runs/27768839212/job/82162895170?pr=577#step:17:643 That's weird. Locally the same setup gives me:

[vagrant@quadlet ~]$ sudo podman exec postgresql psql -U postgres -c 'SHOW password_encryption'
 password_encryption 
---------------------
 scram-sha-256
(1 row)

Which is weird.

It's not weird, as that was the ext DB and that wasn't using our image definition properly. Fixed.

ansible.builtin.include_role:
name: debug_tools

- name: 'Enable postgresql:16 module'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evgeni, let me ask this question again: wouldn't it be more resilient to run the PG commands from inside a PG container instead of installing the client tooling directly on the host?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would, sure. I just had none that I could integrate easily into the various workflows where we need Postgres tooling on the host.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evgeni

evgeni commented Jun 29, 2026

Copy link
Copy Markdown
Member

The upgrade complains:

Jun 28 14:37:27 quadlet.example.com postgresql[123049]: Incompatible data directory.  This container image provides
Jun 28 14:37:27 quadlet.example.com postgresql[123049]: PostgreSQL '16', but data directory is of
Jun 28 14:37:27 quadlet.example.com postgresql[123049]: version '13'.
Jun 28 14:37:27 quadlet.example.com postgresql[123049]: 
Jun 28 14:37:27 quadlet.example.com postgresql[123049]: This image supports automatic data directory upgrade from
Jun 28 14:37:27 quadlet.example.com postgresql[123049]: '15', please _carefully_ consult image documentation
Jun 28 14:37:27 quadlet.example.com postgresql[123049]: about how to use the '$POSTGRESQL_UPGRADE' startup option.

The fact its supporting 15→16 only is encoded here:
https://github.com/sclorg/postgresql-container/blob/f1c89bca212c6a829ab74fdfdeec264f0d08a992/16/Dockerfile.c10s#L13-L14

Funnily, the container actually contains 13 binaries:

% podman run --rm -ti quay.io/sclorg/postgresql-16-c10s bash
…
bash-5.2$ rpm -q postgresql-upgrade
postgresql-upgrade-16.13-2.el10.x86_64
bash-5.2$ rpm -qf /usr/lib64/pgsql/postgresql-13/bin/postgres
postgresql-upgrade-16.13-2.el10.x86_64
bash-5.2$ /usr/lib64/pgsql/postgresql-13/bin/postgres --version
postgres (PostgreSQL) 13.23

I'd argue this is a bug in the image we should ask for a fix.

@evgeni evgeni closed this Jun 29, 2026
@evgeni evgeni reopened this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants